<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
	<title></title>
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
	<link rel="icon" href="/favicon.ico" type="image/x-icon">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="user-scalable=yes, initial-scale=1.0, maximum-scale=2.0, width=960" />
  <meta name="ROBOTS" content="NOODP" />
  <meta name="description" content="" />
  <meta name="keywords" content="" />

	<!-- CSS -->
	<link href="<?php echo $themepath;?>/bootstrap/css/bootstrap.css" rel="stylesheet">
	<link href="<?php echo $stylepath;?>/master.css" rel="stylesheet">
	<link href="<?php echo $stylepath;?>/widget.css" rel="stylesheet">
	
	<!-- Javascript -->
	<script src="http://code.jquery.com/jquery.js"></script>
	<script type="text/javascript" src="<?php echo $themepath;?>/bootstrap/js/bootstrap.js"></script>
	<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<body>
	<div id="fb-root"></div>
  <script>
    window.fbAsyncInit = function() {
      FB.init({
        appId      : '1395236860733535',
        status     : true,
        xfbml      : true
      });
    };

    (function(d, s, id){
       var js, fjs = d.getElementsByTagName(s)[0];
       if (d.getElementById(id)) {return;}
       js = d.createElement(s); js.id = id;
       js.src = "//connect.facebook.net/th_TH/all.js";
       fjs.parentNode.insertBefore(js, fjs);
     }(document, 'script', 'facebook-jssdk'));
  </script>
	<div id="wrapper">
		<div id="top-bg">
			<div id="bottom-bg">
				{_widget topbar}
				<div id="maincontainer">
					<div id="header">
						<div id="logo">
							<h1>รถบรรทุก</h1>
						</div>
						<div id="truck_1"></div>
						<div id="truck_2"></div>
						<ul id="main_menu">
							<li><a href="<?php echo base_url();?>"><img src="<?php echo $imagepath."/home_icon.png";?>" width="18" alt="หน้าแรก Truck.co.th"/></a> <a href="<?php echo base_url();?>" >หน้าแรก</a></li>
							<?php
								if(empty($is_loggedin)){
							?>
							<li><a href="<?php echo base_url("user/register");?>">สมัครสมาชิก</a></li>
							<?php
							}
							?>
							<li><a href="<?php echo base_url("forum");?>">กระดานสนทนา</a></li>
							<li><a href="<?php echo base_url("policy");?>">กฏระเบียบข้อบังคับ</a></li>
							<li><a href="<?php echo base_url("contactus");?>">ติดต่อเรา</a></li>
							<?php $usr_data = $this->session->userdata("user_data");
								if($usr_data){
									if($usr_data['group'] == 2){
									?>
											<li><a href="<?php echo base_url("admin");?>">การจัดการแอดมิน</a></li>
										<?php
										}else if($usr_data['group'] == 1){
										?>
											<li><a href="<?php echo base_url("user");?>">การจัดการผู้ใช้</a></li>
									<?php
									}
								}
							?>
						</ul>
					</div>
					<div class="maincontent" id="maincontent">
						<?php
						if($this->router->class == "home"){
						?>
							<div id="block_tab_first_page">
							</div>
						<?php
						}
						?>

						<div class="left_container">
						<?php
							echo $maincontent;
						?>
						</div>
						<div class="right_container">
							<a class="addBtn" href="<?php echo base_url("post/add");?>" target="_blank">ลงประกาศขายฟรี! <span>ไม่มีค่าใช้จ่าย คลิ๊กเลย!</span></a>
              {_widget search}
							{_widget menu}
							{_include facebookfanpage}
							{_widget activities}
							{_include sidebar}
							{_widget alltopic}
						</div>
						<div class="clear"></div>
					</div>
					<footer>
						<a href="<?php echo base_url();?>">www.Truck.co.th - แหล่งซื้อขายรถบรรทุกที่ใหญ่ที่สุดในประเทศไทย</a>
						 (Executed time:{elapsed_time} RAM Used:{memory_usage})
					</footer>
				</div>
			</div>
		</div>
	</div>

	{_include tracker}
</body>
</html>